package com.dgshanger.sanhxiaofeisc.mvp.contract;

import com.dgshanger.sanhxiaofeisc.entity.PayForDetailEntity;
import com.dgshanger.sanhxiaofeisc.entity.PayResultEntity;
import com.xx.baseuilibrary.mvp.lcec.BaseMvpLcecView;
import com.xx.baseutilslibrary.network.rx.RxHttpObserver;

/**
 * PayForDetailContract
 * 沉迷学习不能自拔
 * Describe：
 * Created by 雷小星🍀 on 2018/5/2 17:20.
 */

public interface PayForDetailContract {

    interface Model {
        /**
         * 加载详情
         */
        void loadDetail(String msg_id, RxHttpObserver<PayForDetailEntity> httpObserver);

        /**
         * 同意代付
         */
        void accept(String extra_id, String type, String pay_type, String user_pay_pwd, RxHttpObserver<PayResultEntity> httpObserver);

        /**
         * 拒绝
         */
        void refuse(String extra_id, RxHttpObserver<Object> httpObserver);
    }

    interface View extends BaseMvpLcecView<PayForDetailEntity> {


        void createAliPay(String info);

        void createWeChatPay(String info);

        /**
         * 获取代付类型
         *
         * @return 代付类型 1=会员支付 2=商家支付
         */
        String getType();

        /**
         * 获取消息id
         *
         * @return 消息id
         */
        String getMsgId();

        /**
         * 获取extraID
         */
        String getExtraId();

        /**
         * 设置数据
         */
        void setData(PayForDetailEntity entity);

        /**
         * 设置拒绝后的UI
         */
        void setRefuseUI();

        /**
         * 设置通过后的UI
         */
        void setAccpteUI();


        void showPayDialog();

        void dismissPayDialog();
    }

    interface Presenter {
        /**
         * 加载详情
         */
        void loadDetail();


        /**
         * 同意代付
         *
         * @param payType 代付类型 1=会员支付 2=商家支付
         */
        void accept(String payType, String payPassword);

        /**
         * 拒绝
         */
        void refuse();

        /**
         * 检查是否设置支付密码
         */
        void checkPayPassword();
    }
}
